home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1999 September / DPPCPRO0999.ISO / Macromed / Flash2 / CD Extras / WebTools / JBS.DXR / 00007_Lite Viewer Code.ls < prev    next >
Encoding:
Text File  |  1997-04-13  |  5.1 KB  |  109 lines

  1. on DisplaySmallRectTiles BtnCastNum
  2.   set TileLocs to [point(368, 57), point(479, 57), point(590, 57), point(368, 121), point(479, 121), point(590, 121), point(368, 185), point(479, 185), point(590, 185), point(368, 249), point(479, 249), point(590, 249), point(368, 313), point(479, 313), point(590, 313)]
  3.   set ShowWidth to 111
  4.   set ShowHeight to 64
  5.   set HiderCast to the number of cast "offScreen"
  6.   set ULoffset to point(0, 0)
  7.   set the castNum of sprite 2 to the number of cast "offScreen"
  8.   set BaseTrack to 24 - 1
  9.   repeat with i = 1 to count(TileLocs)
  10.     set ULloc to getAt(TileLocs, i)
  11.     set the castNum of sprite (BaseTrack + i) to BtnCastNum
  12.     set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
  13.   end repeat
  14.   repeat with i = count(TileLocs) + 1 to 20
  15.     set the castNum of sprite (BaseTrack + i) to HiderCast
  16.   end repeat
  17.   updateStage()
  18. end
  19.  
  20. on DisplaySmallSquareTiles BtnCastNum
  21.   put "DisplaySmallSquareTiles: BtnCastNum = " & BtnCastNum
  22.   set TileLocs to [point(368, 57), point(432, 57), point(496, 57), point(560, 57), point(368, 121), point(432, 121), point(496, 121), point(560, 121), point(368, 185), point(432, 185), point(496, 185), point(560, 185), point(368, 249), point(432, 249), point(496, 249), point(560, 249), point(368, 313), point(432, 313), point(496, 313), point(560, 313)]
  23.   set ShowWidth to 64
  24.   set ShowHeight to 64
  25.   set the castNum of sprite 2 to the number of cast "offScreen"
  26.   set BaseTrack to 24 - 1
  27.   repeat with i = 1 to count(TileLocs)
  28.     set the castNum of sprite (BaseTrack + i) to BtnCastNum
  29.     set ULloc to getAt(TileLocs, i)
  30.     set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
  31.   end repeat
  32.   updateStage()
  33. end
  34.  
  35. on DisplayBigRectTiles BtnCastNum
  36.   set TileLocs to [point(368, 31), point(590, 31), point(368, 159), point(590, 159), point(368, 287), point(590, 287)]
  37.   set ShowWidth to 222
  38.   set ShowHeight to 128
  39.   set HiderCast to the number of cast "offScreen"
  40.   set the castNum of sprite 2 to HiderCast
  41.   set ULoffset to point(the locH of the regPoint of cast BtnCastNum - the left of the rect of cast BtnCastNum, the locV of the regPoint of cast BtnCastNum - the top of the rect of cast BtnCastNum)
  42.   set BaseTrack to 24 - 1
  43.   repeat with i = 1 to count(TileLocs)
  44.     set the castNum of sprite (BaseTrack + i) to BtnCastNum
  45.     set ULloc to getAt(TileLocs, i)
  46.     set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
  47.   end repeat
  48.   repeat with i = count(TileLocs) + 1 to 20
  49.     set the castNum of sprite (BaseTrack + i) to HiderCast
  50.   end repeat
  51.   updateStage()
  52. end
  53.  
  54. on DisplayBigSquareTiles BtnCastNum
  55.   set TileLocs to [point(368, 34), point(496, 34), point(368, 162), point(496, 162), point(368, 290), point(496, 290)]
  56.   set ShowWidth to 128
  57.   set ShowHeight to 128
  58.   set HiderCast to the number of cast "offScreen"
  59.   set the castNum of sprite 2 to HiderCast
  60.   set ULoffset to point(the locH of the regPoint of cast BtnCastNum - the left of the rect of cast BtnCastNum, the locV of the regPoint of cast BtnCastNum - the top of the rect of cast BtnCastNum)
  61.   set BaseTrack to 24 - 1
  62.   repeat with i = 1 to count(TileLocs)
  63.     set the castNum of sprite (BaseTrack + i) to BtnCastNum
  64.     set ULloc to getAt(TileLocs, i)
  65.     set the rect of sprite (BaseTrack + i) to rect(the locH of ULloc, the locV of ULloc, the locH of ULloc + ShowWidth, the locV of ULloc + ShowHeight)
  66.   end repeat
  67.   repeat with i = count(TileLocs) + 1 to 20
  68.     set the castNum of sprite (BaseTrack + i) to HiderCast
  69.   end repeat
  70.   updateStage()
  71. end
  72.  
  73. on displayimage BtnCastNum
  74.   set HiderCast to the number of cast "offScreen"
  75.   repeat with i = 24 to 43
  76.     set the castNum of sprite i to HiderCast
  77.   end repeat
  78.   set DisplayWidth to 608 - 368
  79.   if the width of cast BtnCastNum < DisplayWidth then
  80.     set StageHpos to point(488, 240)
  81.     set castCenter to point(the left of the rect of cast BtnCastNum + ((the right of the rect of cast BtnCastNum - the left of the rect of cast BtnCastNum) / 2), the top of the rect of cast BtnCastNum + ((the bottom of the rect of cast BtnCastNum - the top of the rect of cast BtnCastNum) / 2))
  82.     set CenterOffset to the regPoint of cast BtnCastNum - castCenter
  83.   else
  84.     set StageHpos to point(368, 240)
  85.     set castLeft to point(the left of the rect of cast BtnCastNum, the top of the rect of cast BtnCastNum + ((the bottom of the rect of cast BtnCastNum - the top of the rect of cast BtnCastNum) / 2))
  86.     set CenterOffset to the regPoint of cast BtnCastNum - castLeft
  87.   end if
  88.   set the castNum of sprite 2 to BtnCastNum
  89.   set the loc of sprite 2 to StageHpos + CenterOffset
  90.   updateStage()
  91. end
  92.  
  93. on getMacFileNameFromPath aMacPath
  94.   set the itemDelimiter to ":"
  95.   set fName to item the number of items in aMacPath of aMacPath
  96.   set the itemDelimiter to ","
  97.   return fName
  98. end
  99.  
  100. on yourVersion
  101.   return "Preview version 1.5.0"
  102. end
  103.  
  104. on KillTicks WaitTicks
  105.   set doneTime to the ticks + WaitTicks
  106.   repeat while the ticks < doneTime
  107.   end repeat
  108. end
  109.